package lan_2021;

import java.math.BigInteger;

/**
 * @Author wly
 * @Create 2023-03-26 16:30
 * @Description:https://www.lanqiao.cn/problems/1444/learning/?page=1&first_category_id=1&sort=students_count&name=%E7%9B%B8%E4%B9%98
 */
public class Multiply {
    public static void main(String[] args) {
//        1000000007 999999999
        BigInteger num_2021 = new BigInteger("2021");
        BigInteger num_107 = new BigInteger("1000000007");
        BigInteger num_999 = new BigInteger("999999999");
        for (int i = 1; i <= 1000000007; i++) {
            BigInteger temp = new BigInteger(String.valueOf(i));
            BigInteger res = temp.multiply(num_2021).mod(num_107);
            if (res.equals(num_999)){
                System.out.println(i);
                break;
            }
        }
    }
}
